$(function(){
	$(".login").click(function(){
		var user=$("#zhanghu").val();
		var pwd=$("#pwd").val();
		$.get(
			"http://datainfo.duapp.com/shopdata/userinfo.php",
			{status:'login',userID:user,password:pwd},
			function(data){
			console.log(data)
				if(data==0){
					alert('用户名不存在');
				}else if(data==2){
					alert('用户名密码不服');
				}else{
					if($('#check').prop('checked')){
						localStorage.setItem('auto',user);
						localStorage.setItem(user,pwd);
					}else{
						sessionStorage.setItem('auto',user);
						sessionStorage.setItem(user,pwd);
					}
					alert('登陆成功');
					window.location.href="myuser.html";	
				}
			}
		)
	})
})
